# Maintainer: Renato Silva <br.renatosilva@gmail.com>

pkgname='quilt'
pkgver=0.66
pkgrel=2
pkgdesc='Manage large numbers of patches'
url='https://savannah.nongnu.org/projects/quilt'
groups=('base-devel')
license=('GPL2+')
arch=('any')

depends=(bash bzip2 diffstat diffutils findutils gawk gettext gzip patch perl)
source=("https://savannah.nongnu.org/download/quilt/${pkgname}-${pkgver}.tar.gz")
sha256sums=('314b319a6feb13bf9d0f9ffa7ce6683b06919e734a41275087ea457cc9dc6e07')

build() {
  cd "${pkgname}-${pkgver}"
  ./configure \
      --prefix='/usr' \
      --mandir='/usr/share/man' \
      --without-rpmbuild

  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make prefix="${pkgdir}/usr" mandir="${pkgdir}/usr/share/man" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # Bash completion
  mkdir "${pkgdir}/usr/share/bash-completion"
  mv "${pkgdir}/usr/etc/bash_completion.d" "${pkgdir}/usr/share/bash-completion/completions"
}
